package com.example.generateddl.controller;

import com.example.generateddl.pojo.PdmEntity;
import com.example.generateddl.service.DealWithExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DealWithExcelController {
    @Autowired
    private DealWithExcelService dealWithExcelServiceImpl;
    @PostMapping("/read")
    public List<PdmEntity> readExceldata (@RequestParam String filePath) {
        List<PdmEntity> pdmEntities = dealWithExcelServiceImpl.readExcelData(filePath);
        return pdmEntities;
    }

    @PostMapping("/createTable")
    public String dealWithPdmEntities (@RequestParam String filePath) {
        return dealWithExcelServiceImpl.dealWithPdmEntities(filePath);
    }


}
